package main

import (
	"errors"
	"fmt"

	log "github.com/sirupsen/logrus"
)

func divide(a, b float64) (float64, error) {
	if b == 0 {
		return 0, errors.New("division by zero")
	}
	return a / b, nil
}

func test_deferpanic(s string) {
	numerator := 10.0
	denominator := 0.0
	fmt.Println("😊")

	result, err := divide(numerator, denominator)
	if err != nil {
		log.WithError(err).WithField("cidr", s).Panic("Failed to parse CIDR")
	} else {
		fmt.Println("Result:", result)
	}

	fmt.Println("😊")
}

func main() {
	test_deferpanic("test")
}
